Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add basic latency metrics #616

Merged
merged 3 commits into from
May 14, 2024
Merged

feat: add basic latency metrics #616

merged 3 commits into from
May 14, 2024

Conversation

0x416e746f6e
Copy link
Contributor

📝 Summary

Add basic latency metrics for GetPayload and PublishBlock.

⛱ Motivation and Context

We want to be able to track those metrics per-instance as well as aggregate them across the whole service (running behind the load-balancer).


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@0x416e746f6e 0x416e746f6e self-assigned this May 6, 2024
@0x416e746f6e 0x416e746f6e marked this pull request as ready for review May 6, 2024 11:36
@@ -1552,6 +1564,7 @@ func (api *RelayAPI) handleGetPayload(w http.ResponseWriter, req *http.Request)
msNeededForPublishing = uint64(timeAfterPublish - timeBeforePublish)
log = log.WithField("timestampAfterPublishing", timeAfterPublish)
log.WithField("msNeededForPublishing", msNeededForPublishing).Info("block published through beacon node")
metrics.PublishBlockLatencyHistogram.Record(req.Context(), float64(timeAfterPublish-timeBeforePublish))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use msNeededForPublishing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair. updated accordingly.

avalonche
avalonche previously approved these changes May 6, 2024
@metachris metachris merged commit d6eaf00 into main May 14, 2024
4 checks passed
@metachris metachris deleted the feat/prometheus-metrics branch May 14, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants